# Maintainer: Alexey Pavlov <alexpux@gmail.com>

pkgname=gengetopt
pkgver=2.22.6
pkgrel=3
pkgdesc="A tool to write command line option parsing code for C programs."
arch=('i686' 'x86_64' 'arm' 'armv6h')
url="https://www.gnu.org/software/gengetopt/gengetopt.html"
license=("GPL")
options=('!docs' '!makeflags')
makedepends=('bison' 'flex' 'gcc' 'help2man')
source=(https://ftp.gnu.org/gnu/gengetopt/${pkgname}-${pkgver}.tar.gz{,.sig}
        msysize.patch)
sha256sums=('30b05a88604d71ef2a42a2ef26cd26df242b41f5b011ad03083143a31d9b01f7'
            'SKIP'
            'f2d6762982e46de578a65a47b3c270fd7409a03768d3f59df9dbd4413a0eeb19')

prepare() {
  cd ${srcdir}/${pkgname}-${pkgver}
  patch -p1 -i ${srcdir}/msysize.patch
}

build() {
  cd ${srcdir}/${pkgname}-${pkgver}

  ./configure --prefix=/usr
  make
}

package() {
  cd ${srcdir}/${pkgname}-${pkgver}
  make DESTDIR=${pkgdir} install
}
